package cn.dnui_xqh414.dnuifood_16110100414.service;

import java.util.List;

import cn.dnui_xqh414.dnuifood_16110100414.bean.RegisterBean;
import cn.dnui_xqh414.dnuifood_16110100414.bean.ResultBean;
import cn.dnui_xqh414.dnuifood_16110100414.bean.UserInfo;
import cn.dnui_xqh414.dnuifood_16110100414.bean.Userbean;
import cn.dnui_xqh414.dnuifood_16110100414.bean.getAllCommentsBean;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

public interface UserService {
    @GET("userLogin.do")
    Call<Userbean> doLogin(@Query("username") String username,
                           @Query("userpass") String userpass);

    @GET("userRegister.do")
    Call<RegisterBean> doRegister(
            @Query("username") String username,
            @Query("userpass") String password,
            @Query("mobilenum") String mobile,
            @Query("address") String address,
            @Query("comment ") String comment);

    @GET("getUserById.do")
    Call<UserInfo> getUser(
            @Query("user_id") int userId
    );

    @GET("insertOrder.do")
    Call<ResultBean> JustBuyIt(
        @Query("user_id") int userId,
        @Query("food_id") int foodId,
        @Query("num") int num,
        @Query("sum") int sum,
        @Query("suggesttime") String time,
        @Query("address") String address
    );

    @GET("updateUserById.do")
    Call<ResultBean> UpdateUser(
            @Query("user_id") int user_id,
            @Query("username") String username,
            @Query("userpass") String password,
            @Query("mobilenum") String mobile,
            @Query("address") String address
    );

    @GET("insertComment.do")
    Call<ResultBean> insertComment (
            @Query("item_id") int itemId,
            @Query("content") String content
    );

    @GET("getAllOrdersByUser.do")
    Call<List<getAllCommentsBean>> getAllOrder(
            @Query("user_id") int UserID
    );
}


